home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / gamesmaster / includes / games / games.e < prev    next >
Encoding:
Text File  |  1996-09-13  |  9.9 KB  |  367 lines

  1.  
  2. /*    $VER: games.e 0.3 (08.09.96)
  3. **    Includes Release xx.xx
  4. **
  5. **    General include file for programs using the Games Master System.
  6. **
  7. **    (C) Copyright 1996 DreamWorld Productions.
  8. **        All Rights Reserved
  9. */
  10.  
  11. OPT MODULE
  12. OPT EXPORT
  13.  
  14. CONST FILTER_OFF  = 0,
  15.       FILTER_ON   = 1
  16.  
  17. CONST LISTSTART   = "LIST",
  18.       LISTEND     = 0,
  19.       ENDLIST     = 0
  20.  
  21. -> Universal joystick status bits returned from Read_Joystick, Sega,
  22. -> JoyPad, etc...
  23.  
  24. CONST JT_SWITCH = 0,
  25.       JT_ZBXY   = 1,
  26.  
  27.       JS_LEFT   = $00000001,
  28.       JS_RIGHT  = $00000002,
  29.       JS_UP     = $00000004,
  30.       JS_DOWN   = $00000008,
  31.       JS_ZIN    = $00000010, 
  32.       JS_ZOUT   = $00000020,
  33.       JS_FIRE1  = $00000040,          -> Fire Buttons 
  34.       JS_FIRE2  = $00000080,          -> <-For 2 button joysticks 
  35.  
  36.       JS_RED    = $00000040,
  37.       JS_BLUE   = $00000080,
  38.       JS_PLAY   = $00000100,          -> CD32 buttons here 
  39.       JS_RWD    = $00000200,
  40.       JS_FFW    = $00000400,
  41.       JS_GREEN  = $00000800,
  42.       JS_YELLOW = $00001000,
  43.  
  44.       JB_FIRE1  = $00010000,         -> For the ZBXY style return type 
  45.       JB_FIRE2  = $00020000,         ->  (analog joysticks) 
  46.  
  47.       MB_LMB    = $00010000,         -> Mouse button flags returned from 
  48.       MB_RMB    = $00020000,         ->  Read_Mouse(), in ZBXY format 
  49.       MB_MMB    = $00040000
  50.  
  51. -> Joyport specifications for calling Read_JoyStick/Mouse/JoyPad...() 
  52.  
  53. CONST JPORT1 = 0*2,
  54.       JPORT2 = 1*2,
  55.       JPORT3 = 2*2,
  56.       JPORT4 = 3*2
  57.  
  58. PROC getZBXYx(zb)
  59.     DEF    ret:LONG
  60.     MOVE.L    zb,D0
  61.     ASR.W    #8,D0
  62.     MOVE.L    D0,ret
  63.     RETURN    ret
  64. ENDPROC
  65.  
  66. PROC getZBXYy(zb)
  67.     DEF    ret:LONG
  68.     MOVE.L    zb,D0
  69.     EXT.W    D0
  70.     EXT.L    D0
  71.     MOVE.L    D0,ret
  72.     RETURN    ret
  73. ENDPROC
  74.  
  75. -> RasterList support commands.
  76.  
  77. CONST CM_WAITLINE = 11, CM_COL12 = 00, CM_COL24 = 01, CM_COL12LIST = 02,
  78.       CM_COL24LIST = 03, CM_SPRITE = 04, CM_SCROLL = 05, CM_FLOOD = 07,
  79.       CM_REPOINT = 08, CM_MIRROR = 09, CM_NEWPALETTE = 10, CM_RASTEND = -1
  80.  
  81. OBJECT waitline
  82.    command      :INT
  83.    line         :INT
  84.    reserved     :LONG
  85. ENDOBJECT
  86.  
  87. OBJECT col12
  88.    command      :INT
  89.    colour       :INT
  90.    value        :INT
  91.    reserved     :LONG
  92. ENDOBJECT
  93.  
  94. OBJECT col24
  95.    command      :INT
  96.    colour       :INT
  97.    value        :LONG
  98.    reserved     :LONG
  99. ENDOBJECT
  100.  
  101. OBJECT col12list
  102.    command      :INT
  103.    line         :INT
  104.    skip         :INT
  105.    colour       :INT
  106.    colourlist   :LONG
  107.    reserved     :LONG
  108. ENDOBJECT
  109.  
  110. OBJECT col24list
  111.    command      :INT
  112.    line         :INT
  113.    skip         :INT
  114.    colour       :INT
  115.    colourlist   :LONG
  116.    reserved     :LONG
  117. ENDOBJECT
  118.  
  119. OBJECT spr
  120.    command      :INT
  121.    sprite       :LONG
  122.    reserved     :LONG
  123. ENDOBJECT
  124.  
  125. OBJECT flood
  126.    command      :INT
  127.    reserved     :LONG
  128. ENDOBJECT
  129.  
  130. OBJECT repoint
  131.    command      :INT
  132.    bitplane     :LONG
  133.    reserved     :LONG
  134. ENDOBJECT
  135.  
  136. OBJECT mirror
  137.    command      :INT
  138.    reserved     :LONG
  139. ENDOBJECT
  140.  
  141. OBJECT newpalette
  142.    command      :INT
  143.    colstart     :INT
  144.    amtcols      :INT
  145.    palette      :LONG
  146.    reserved     :LONG
  147. ENDOBJECT
  148.  
  149. OBJECT rastend
  150.    command      :LONG
  151. ENDOBJECT
  152.  
  153. -> GPI ID numbers. 
  154.  
  155. CONST GPI_SCREENS = 0,
  156.       GPI_BLITTER = 4,
  157.       GPI_SOUND   = 8,
  158.       GPI_NETWORK = 12,
  159.       GPI_VECTORS = 16,
  160.       GPI_DEBUG   = 20,
  161.       GPI_ANIM    = 24,
  162.       GPI_REKO    = 28
  163.  
  164. -> Standard screen structure. 
  165.  
  166. CONST GSV1 = $47535631   -> Structure ID (goes in gamescreen.version)
  167.  
  168. OBJECT gamescreen
  169.     version      :LONG  -> Structure version - "GSV1"
  170.     stats        :LONG  -> Private
  171.     memptr1      :LONG  -> Ptr to screen 1
  172.     memptr2      :LONG  -> Ptr to screen 2 (double buffer)
  173.     memptr3      :LONG  -> Ptr to screen 3 (triple buffer)
  174.     screenlink   :LONG  -> Ptr to a linked screen
  175.     palette      :LONG  -> Ptr to the screen palette
  176.     rasterlist   :LONG  -> Ptr to a rasterlist
  177.     amtcolours   :LONG  -> The amount of colours in the palette.
  178.     scrwidth     :INT   -> The width of the visible screen
  179.     scrheight    :INT   -> The height of the visible screen
  180.     picwidth     :INT   -> The width of the entire screen
  181.     picheight    :INT   -> The height of the entire screen
  182.     planes       :INT   -> The amount of planes in da screen
  183.     scrxoffset   :INT   -> Hardware co-ordinate for TOS
  184.     scryoffset   :INT   -> Hardware co-ordinate for LOS
  185.     picxoffset   :INT   -> Offset of the horizontal axis
  186.     picyoffset   :INT   -> Offset of the vertical axis
  187.     attributes   :LONG  -> Special Attributes are?
  188.     mode         :INT   -> What screen mode is it?
  189.     type         :CHAR  -> Interleaved/Planar/Chunky?
  190.     displayed    :CHAR  -> Private
  191. ENDOBJECT
  192.  
  193. -> SCREEN TYPES (flags for SS_ScrType) 
  194.  
  195. CONST INTERLEAVED = 0,      -> These are actual numbers 
  196.       PLANAR      = 1,      -> rather than bits 
  197.       CHUNKY      = 2
  198.  
  199. -> SCREEN ATTRIBUTES (flags and bits for SS_ScrAttrib) 
  200.  
  201. CONST DBLBUFFER = $00000001,  -> For double buffering 
  202.       TPLBUFFER = $00000002,  -> Triple buffering!! 
  203.       PLAYFIELD = $00000004,  -> Set if it's part of a playfield 
  204.       HSCROLL   = $00000008,  -> Gotta set this to do scrolling 
  205.       VSCROLL   = $00000010,  -> For vertical scrolling 
  206.       SPRITES   = $00000020,  -> Set this if you want sprites 
  207.       HBUFFER   = $00000040,  -> Creates a scroll buff for up to 100 screens.
  208.       ->        = $00000080,
  209.       BLKBDR    = $00000100,  -> Gives a blackborder on AGA machines 
  210.       NOSPRBDR  = $00000200   -> For putting sprites in the border 
  211.  
  212. -> SCREEN MODES (flags for SS_ScrMode) 
  213.  
  214. CONST LORES      = $0000,   -> Low resolution (default) 
  215.       HIRES      = $0001,   -> High resolution 
  216.       SHIRES     = $0002,   -> Super-High resolution 
  217.       INTERLACED = $0004,   -> Interlaced 
  218.       NTSC       = $0020,   -> Set if you wrote this game in NTSC 
  219.       HAM        = $0040,   -> For HAM mode 
  220.       COL24BIT   = $0080    -> 24Bit colours (default is 12Bits) 
  221.  
  222. -> Universal errorcodes returned by certain functions.
  223.  
  224. CONST ERR_OK     = 0,       -> Function went OK (also NULL) 
  225.       ERR_NOMEM  = 1,       -> Not enough memory available 
  226.       ERR_NOPTR  = 2,       -> Required pointer not present 
  227.       ERR_INUSE  = 3,       -> Previous allocations have not been freed 
  228.       ERR_NOVER  = 4,       -> Structure version not supported or not found 
  229.       ERR_FAILED = 5        -> General failure 
  230.  
  231. -> Sprite structure.
  232.  
  233. CONST SPV1 = $53505631
  234.  
  235. OBJECT sprite
  236.    version       :LONG  -> Structure version (SPV1)
  237.    stats         :LONG  -> Reserved.
  238.    number        :INT   -> Bank number to access 
  239.    data          :LONG  -> Pointer to Sprite graphic 
  240.    xpos          :INT   -> X position 
  241.    ypos          :INT   -> Y position 
  242.    frame         :INT   -> Frame number 
  243.    width         :INT   -> Width in pixels 
  244.    height        :INT   -> Height in pixels 
  245.    amtcolours    :INT   -> 4 or 16 
  246.    colStart      :INT   -> Colour bank to access, increments of 16 
  247.    planes        :INT   -> Amount of planes per bank 
  248.    resolution    :INT   -> HiRes/LoRes/SHiRes/XLONG 
  249.    fieldpriority :INT   -> Field position in relation to playfields 
  250.    spritesize    :LONG  -> Reserved 
  251.    framesize     :LONG  -> Reserved 
  252. ENDOBJECT
  253.  
  254. CONST SPR_OCS = $0010,
  255.       SPR_AGA = $0020,
  256.       XLONG   = $0040
  257.  
  258. -> BOB Drawing Methods 
  259.  
  260. CONST    INTLV_NCNM = 00,    -> No clip, no mask 
  261.     INTLV_NCYM = 01,    -> No clip, masked 
  262.     INTLV_YCNM = 02,    -> Clip, no mask 
  263.     INTLV_YCYM = 03,    -> Clip, masked 
  264.     PLNR_NCNM  = 04,
  265.     PLNR_NCYM  = 05,
  266.     PLNR_YCNM  = 06,
  267.     PLNR_YCYM  = 07,
  268.     CHNKY_NCNM = 08,
  269.     CHNKY_NCYM = 09,
  270.     CHNKY_YCNM = 10,
  271.     CHNKY_YCYM = 11
  272.  
  273. -> The picture structure for loading and depacking of pictures.
  274.  
  275. CONST PCV1 = $50435631
  276.  
  277. OBJECT picture
  278.    version     :LONG  -> "PCV1"
  279.    stats       :LONG  -> Reserved.
  280.    data        :LONG  -> Source.
  281.    width       :INT   -> Picture Width
  282.    height      :INT   -> Picture Height
  283.    planes      :INT   -> Amount of planes
  284.    amtcolours  :LONG  -> Amount of colours.
  285.    palette     :LONG  -> Ptr to Palette.
  286.    scrMode     :INT   -> Intended screen mode for picture.
  287.    type        :INT   -> Interleaved/Chunky/Planar
  288.    attrib      :LONG  -> GETPALETTE/VIDEOMEM/
  289. ENDOBJECT
  290.  
  291. -> Choose one of these for calling Set_Interrupt().
  292.  
  293. CONST    INTB_INTEN   = 14,  -> Master interrupt (enable only ) 
  294.     INTB_EXTER   = 13,  -> External interrupt 
  295.     INTB_DSKSYNC = 12,  -> Disk re-SYNChronized 
  296.     INTB_RBF     = 11,  -> serial port Receive Buffer Full 
  297.     INTB_AUD3    = 10,  -> Audio channel 3 block finished 
  298.     INTB_AUD2    = 9,   -> Audio channel 2 block finished 
  299.     INTB_AUD1    = 8,   -> Audio channel 1 block finished 
  300.     INTB_AUD0    = 7,   -> Audio channel 0 block finished 
  301.     INTB_BLIT    = 6,   -> Blitter finished 
  302.     INTB_VERTB   = 5,   -> start of Vertical Blank 
  303.     INTB_COPER   = 4,   -> Coprocessor 
  304.     INTB_PORTS   = 3,   -> I/O Ports and timers 
  305.     INTB_SOFTINT = 2,   -> software interrupt rest 
  306.     INTB_DSKBLK  = 1,   -> Disk Block done 
  307.     INTB_TBE     = 0    -> serial port Transmit Buffer Empty 
  308.  
  309. -> Special Keypresses that can be returned from Read_Key().  All other
  310. -> keys can be considered to be in ASCII format.
  311.  
  312.  
  313. OBJECT keys
  314.    id   :INT
  315.    key1 :CHAR
  316.    key2 :CHAR
  317.    key3 :CHAR
  318.    key4 :CHAR
  319. ENDOBJECT
  320.  
  321. CONST K_SCS     = $80,      -> Screen switch (LEFTAMIGA + M) 
  322.       K_DEL     = $81,
  323.       K_HELP    = $82,
  324.       K_LSHIFT  = $83,
  325.       K_RSHIFT  = $84,
  326.       K_CAPS    = $85,
  327.       K_CTRL    = $86,
  328.       K_LALT    = $87,
  329.       K_RALT    = $88,
  330.       K_LAMIGA  = $89,
  331.       K_RAMIGA  = $8a,
  332.  
  333.       K_F1      = $8b,
  334.       K_F2      = $8c,
  335.       K_F3      = $8d,
  336.       K_F4      = $8e,
  337.       K_F5      = $8f,
  338.       K_F6      = $90,
  339.       K_F7      = $91,
  340.       K_F8      = $92,
  341.       K_F9      = $93,
  342.       K_F10     = $94,
  343.       K_F11     = $95,
  344.       K_F12     = $96,
  345.       K_F13     = $97,
  346.       K_F14     = $98,
  347.       K_F15     = $99,
  348.       K_F16     = $9a,
  349.       K_F17     = $9b,
  350.       K_F18     = $9c,
  351.       K_F19     = $9d,
  352.       K_F20     = $9e,
  353.  
  354.       C_UP      = $9f,
  355.       C_DOWN    = $a0,
  356.       C_RIGHT   = $a1,
  357.       C_LEFT    = $a2,
  358.  
  359.       K_SRIGHT  = $a3,      -> Special key on right 
  360.       K_SLEFT   = $a4,      -> Special key on left 
  361.  
  362.       K_TAB     = 09,
  363.       K_BAKSPC  = 08,
  364.       K_ENTER   = 10,
  365.       K_RETURN  = 10,
  366.       K_ESC     = ""
  367.